/**
 * Copyright (C) 2011 Andrew C. Love (DNC) <dnc.app.sup@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


package com.dnc.cloak.framework.messaging;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.dnc.cloak.framework.model.AbstractModel;

public class EmailMessage extends AbstractModel implements Serializable {
	
    private String contentType = "text/plain";
    private String mailFrom = null;
    private List<String> mailToList = null;
    private List<String> mailToCcList = null;
    private List<String> mailToBccList = null;
    private List<String> mailReplyToList = null;
    private String smtpHost = null;
    private String subject = null;
    private String message= null;
    private String smtpUser = null;
    private String smtpPassword = null;
    private int bufferSize = 1024;
    private Boolean smtpDebug = false;
    private String smtpProtocol = "smtps";
    private int port = -1;
        
    public String getContentType() {        
        return contentType;
    }
    
    public void setContentType(String contentType) {
        this.contentType = contentType;
    }
    
    public String getMailFrom() {
        return mailFrom;
    }
    
    public void setMailFrom(String mailFrom) {
        this.mailFrom = mailFrom;
    }
    
    public List<String> getMailToList() {
        return mailToList;
    }
    
    public void setMailToList(List<String> mailToList) {
        this.mailToList = mailToList;
    }
    
    public void AddMailTo(String recipient) {
        if (this.mailToList == null) {
            this.mailToList = new ArrayList <String>();            
        }
        this.mailToList.add(recipient);
    }
    
    public String getSmtpHost() {
        return smtpHost;
    }
    
    public void setSmtpHost(String smtpHost) {
        this.smtpHost = smtpHost;
    }
    
    public String getSubject() {
        return subject;
    }
    
    public void setSubject(String subject) {
        this.subject = subject;
    }
    
    public String getMessage() {
        return message;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }
    
    public String getSmtpUser() {
        return smtpUser;
    }
    
    public void setSmtpUser(String smtpUser) {
        this.smtpUser = smtpUser;
    }
    
    public String getSmtpPassword() {
        return smtpPassword;
    }
    
    public void setSmtpPassword(String smtpPassword) {
        this.smtpPassword = smtpPassword;
    }
    
    public int getBufferSize() {
        return bufferSize;
    }
    
    public void setBufferSize(int bufferSize) {
        this.bufferSize = bufferSize;
    }
    
    public List<String> getMailToCcList() {
        return mailToCcList;
    }
    
    public void setMailToCcList(List<String> mailToCcList) {
        this.mailToCcList = mailToCcList;
    }
    
    public void AddMailToCc(String recipient) {
        if (this.mailToCcList == null) {
            this.mailToCcList = new ArrayList <String>();            
        }
        this.mailToCcList.add(recipient);
    }
    
    
    public List<String> getMailToBccList() {
        return mailToBccList;
    }
    
    public void setMailToBccList(List<String> mailToBcCList) {
        this.mailToBccList = mailToBcCList;
    }
    
    public void AddMailToBcc (String recipient) {
        if (this.mailToBccList == null) {
            this.mailToBccList = new ArrayList <String>();            
        }
        this.mailToBccList.add(recipient);
    }
    
    
    public List<String> getMailReplyToList() {
        return mailReplyToList;
    }
    
    public void setMailReplyToList(List<String> mailReplyToList) {
        this.mailReplyToList = mailReplyToList;
    }
    
    public void AddMailReplyTo (String recipient) {
        if (this.mailReplyToList == null) {
            this.mailReplyToList = new ArrayList <String>();            
        }
        this.mailReplyToList.add(recipient);
    }
    
    
    public Boolean getSmtpDebug() {
        return smtpDebug;
    }
    
    public void setSmtpDebug(Boolean smtpDebug) {
        this.smtpDebug = smtpDebug;
    }
    
    public String getSmtpProtocol() {
        return smtpProtocol;
    }
    
    public void setSmtpProtocol(String smtpProtocol) {
        this.smtpProtocol = smtpProtocol;
    }
    
    public int getPort() {
        return port;
    }
    
    public void setPort(int port) {
        this.port = port;
    }
    
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("EmailMessage [getBufferSize()=");
        builder.append(getBufferSize());
        builder.append(", getContentType()=");
        builder.append(getContentType());
        builder.append(", getMailFrom()=");
        builder.append(getMailFrom());
        builder.append(", getMailReplyToList()=");
        builder.append(getMailReplyToList());
        builder.append(", getMailToBccList()=");
        builder.append(getMailToBccList());
        builder.append(", getMailToCcList()=");
        builder.append(getMailToCcList());
        builder.append(", getMailToList()=");
        builder.append(getMailToList());
        builder.append(", getMessage()=");
        builder.append(getMessage());
        builder.append(", getPort()=");
        builder.append(getPort());
        builder.append(", getSmtpDebug()=");
        builder.append(getSmtpDebug());
        builder.append(", getSmtpHost()=");
        builder.append(getSmtpHost());
        builder.append(", getSmtpPassword()=");
        builder.append(getSmtpPassword());
        builder.append(", getSmtpProtocol()=");
        builder.append(getSmtpProtocol());
        builder.append(", getSmtpUser()=");
        builder.append(getSmtpUser());
        builder.append(", getSubject()=");
        builder.append(getSubject());
        builder.append("]");
        return builder.toString();
    }   
    
}
